package com.dubbo.provider.service.impl;

import com.dubbo.api.entity.ContractResponse;
import com.dubbo.api.service.IContractDubboService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @Author Gavin
 * @Date 2023/01/31 11:18
 */
@Slf4j
@Service
@DubboService(interfaceClass = IContractDubboService.class, version = "1.0.0", timeout = 60000)
public class ContractDubboServiceImpl implements IContractDubboService {

    @Override
    public ContractResponse genContract(Map<String, String> map) {
        ContractResponse contractResponse = new ContractResponse();
        contractResponse.setResponseCode("00000000");
        contractResponse.setResponseDesc("SUCCESS");
        contractResponse.setResponseTime(LocalDateTime.now());
        log.info("============Dubbo provider============");
        return contractResponse;
    }
}
